Skip to content

Fix NullPointerException when offloading a consuming upsert segment with metadataTTL - #20385

Open
Indian-boult wants to merge 1 commit into
apache:masterfrom
Indian-boult:fix/upsert-ttl-offload-consuming-segment
Open

Indian-boult wants to merge 1 commit into
apache:masterfrom
Indian-boult:fix/upsert-ttl-offload-consuming-segment

Conversation

@Indian-boult

Copy link
Copy Markdown
Contributor

Fixes #20384

isOutOfMetadataTTL now returns false for a MutableSegment. A consuming segment has no column metadata to read its max comparison value from, and it holds the newest records of its partition, so it is always within TTL. Offloading it now removes its primary keys like any other segment that is within TTL.

ConcurrentMapPartitionUpsertMetadataManagerTest.testOffloadConsumingSegmentWithMetadataTTL builds a real MutableSegmentImpl with metadataTTL 30, indexes three rows and offloads it. On master it throws the NullPointerException from the issue. With the change it passes, and so do the 87 tests in the upsert metadata manager test classes. Spotless, checkstyle and license checks pass on pinot-segment-local.

removeSegment asks isOutOfMetadataTTL whether to keep the metadata of
the segment, and isOutOfMetadataTTL reads the max comparison value from
the column metadata. A consuming segment has no column metadata, so
offloading it from a table with metadataTTL threw a
NullPointerException and the CONSUMING to OFFLINE or DROPPED
transition failed. A consuming segment holds the latest records of the
partition, so it is now always treated as within TTL and its primary
keys are removed.

Fixes apache#20384
@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.47%. Comparing base (4b27e22) to head (7733fa4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...cal/upsert/BasePartitionUpsertMetadataManager.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #20385       +/-   ##
=============================================
+ Coverage     61.23%   71.47%   +10.23%     
- Complexity        1     1633     +1632     
=============================================
  Files          2793     3615      +822     
  Lines        180530   244529    +63999     
  Branches      30232    39771     +9539     
=============================================
+ Hits         110556   174768    +64212     
+ Misses        60642    56564     -4078     
- Partials       9332    13197     +3865     
Flag Coverage Δ
java-25 71.47% <0.00%> (+10.23%) ⬆️
temurin 71.47% <0.00%> (+10.23%) ⬆️
unittests 71.47% <0.00%> (+10.23%) ⬆️
unittests1 61.21% <0.00%> (-0.03%) ⬇️
unittests2 42.98% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offloading a consuming segment of an upsert table with metadataTTL throws a NullPointerException

2 participants